//
//  OrderNoSourceCell.m
//  ChampoinPeso
//
//  Created by mac on 2025/2/19.
//

#import "OrderNoSourceCell.h"
@interface OrderNoSourceCell()
@end
@implementation OrderNoSourceCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}
-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self setupUI];
    }
    return  self;
}

-(void)setupUI{
    UILabel *lab = [UILabel new];
    lab.text = @"There are no orders here yet";
    lab.textColor = DetailColor;
    lab.font = [UIFont systemFontOfSize:16];
    [self.contentView addSubview:lab];
    [lab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.center.mas_equalTo(self.contentView);
    }];
    
    UIImageView *img = [UIImageView new];
    img.image = [UIImage imageNamed:@"nosource"];
    [self.contentView addSubview: img];
    [img mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.mas_equalTo(self.contentView);
        make.bottom.equalTo(lab.mas_top).offset(-17);
    }];
    
    [self.contentView addSubview:self.apply];
    [_apply mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.mas_equalTo(self.contentView);
        make.top.equalTo(lab.mas_bottom).offset(99);
    }];

}

-(UIButton *)apply
{
    if (!_apply) {
        _apply = [UIButton buttonWithType:UIButtonTypeCustom];
        [_apply setImage:[UIImage imageNamed:@"applynow"] forState:UIControlStateNormal];
    }
    return _apply;
}

@end
